package com.neusoft.yuejian_6.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.neusoft.yuejian_6.R;
import com.squareup.picasso.Picasso;



public class TrainDetailActivity extends AppCompatActivity {

    private ImageView train_pic;
    private TextView train_intro;
    private TextView train_phone;
    private TextView train_address;
    private int train_id;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_train_detail);
        initView();
        getTrainData();
    }

    private void getTrainData() {
        Bundle bundle = this.getIntent().getExtras();
        String trainintro = bundle.getString("train_intro");
        String trainaddress = bundle.getString("train_address");
        String trainphone = bundle.getString("train_phone");
       // int tprice = bundle.getInt("t_price");
        String tpic = "http://10.0.2.2/neu1_yuejian/Public/Admin/photo/"+bundle.getString("train_pic");
        //String ttime = bundle.getString("t_time");
      //System.out.print("taddress");
        train_intro.setText(trainintro);
        train_address.setText(trainaddress);
        train_phone.setText(trainphone);
       // t_price.setText(tprice+"");
   //System.out.print("train_intro");
     //   t_time.setText(ttime);
        Picasso.with(this).load(tpic).into(train_pic);
    }


    private void initView() {

        train_pic = (ImageView) findViewById(R.id.train_pic);
          train_intro = (TextView) findViewById(R.id.train_intro);
        train_address = (TextView) findViewById(R.id.train_address);
         train_phone = (TextView) findViewById(R.id.train_phone);
    }

    /**
     * ATTENTION: This was auto-generated to implement the App Indexing API.
     * See https://g.co/AppIndexing/AndroidStudio for more information.
     */

}
